package uz.edo.security;
import org.apache.wicket.Component;
import org.apache.wicket.authorization.Action;

import uz.edo.db.bean.User;


public class MyAuthorization
{
    public static boolean isActionAuthorized(Component component, Action action, User user)
    {
        if(component instanceof MyAuthenticatedPage)
            return ((MyAuthenticatedPage)component).isAuthorized(user.getHashMapRole());
//        else if(component instanceof MyAuthenticatedPageLink)
//            return ((MyAuthenticatedPageLink)component).isAuthorized(user.getRights());

        return true;
    }
}